<template>
  <div class="home-banner">
    <xtx-slider :data='sliders'></xtx-slider>
  </div>
</template>

<script>
// import { ref, onMounted } from 'vue'
// import { findBanner } from '@/api/home'
import { useBanner } from '@/hooks/page'
export default {
  name: 'HomeBanner',

  setup () {
    /*    //  所有图片列表
    const sliders = ref([])

    // 获取轮播图数据
    const getSliderData = async () => {
      const { result } = await findBanner()
      sliders.value = result
    }

    onMounted(() => {
      getSliderData()
    }) */

    const { sliders } = useBanner()

    return { sliders }
  }
}
</script>

<style scoped lang='less'>
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
</style>
